package com.yztstudy.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;

/**
 * 购物车的实体类
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "cart")
public class Cart implements Serializable {

    public static final Long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id; // 主键

    @TableField(value = "user_id")
    @JsonProperty("user_id")
    private Integer userId; // 用户主键

    @TableField(value = "product_id")
    @JsonProperty("product_id")
    private Integer productId; //商品主键

    @TableField(value = "num")
    private Integer num; // 数量
}
